import pytest
from selenium.webdriver import Chrome,Edge

from config.config import config
from utils.LogUtil import logger_init
@pytest.fixture(scope='class')
def driver():
    # option = webdriver.ChromeOptions()
    # option.binary_location = "F:/Program Files/Google/Chrome/Application/chrome.exe"
    # _driver = webdriver.Chrome(options=option)
    _driver = Chrome()
    _driver.maximize_window()
    yield _driver
    _driver.quit()

@pytest.fixture(scope='session',params=['chrome','edge'])
def drivers(request):
    if request.param == 'chrome':
        _driver = Chrome()
    elif request.param == 'edge':
        _driver = Edge()
    yield _driver
    _driver.quit()

@pytest.fixture(scope='session')
def hostname():
    yield config.host


@pytest.fixture(scope='module')
def logger(request):
    print(request.module.__name__)
    yield logger_init(request.module.__name__)

